package cn.zust.ly.EyExample.Ey05;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		int a[] = new int[10010];
		for (int i = 0; i < n; i++) {
			int x = sc.nextInt();
			if (a[x] == 0) a[x] = i + 1;
		}
		
		int y = sc.nextInt();
		if (a[y] == 0) System.out.println(-1);
		else System.out.println(a[y]);
		
	}
}
